import { createRouter, createWebHistory } from 'vue-router'

import Layout from '@/layout/index.vue'

/**
 * Note: 路由配置项
 *
 * hidden: true                     // 当设置 true 的时候该路由不会再侧边栏出现 如401，login等页面，或者如一些编辑页面/edit/1
 * alwaysShow: true                 // 当你一个路由下面的 children 声明的路由大于1个时，自动会变成嵌套的模式--如组件页面
 *                                  // 只有一个时，会将那个子路由当做根路由显示在侧边栏--如引导页面
 *                                  // 若你想不管路由下面的 children 声明的个数都显示你的根路由
 *                                  // 你可以设置 alwaysShow: true，这样它就会忽略之前定义的规则，一直显示根路由
 * redirect: noRedirect             // 当设置 noRedirect 的时候该路由在面包屑导航中不可被点击
 * name:'router-name'               // 设定路由的名字，一定要填写不然使用<keep-alive>时会出现各种问题
 * query: '{"id": 1, "name": "ry"}' // 访问路由的默认传递参数
 * roles: ['admin', 'common']       // 访问路由的角色权限
 * permissions: ['a:a:a', 'b:b:b']  // 访问路由的菜单权限
 * meta : {
    noCache: true                   // 如果设置为true，则不会被 <keep-alive> 缓存(默认 false)
    title: 'title'                  // 设置该路由在侧边栏和面包屑中展示的名字
    icon: 'svg-name'                // 设置该路由的图标，对应路径src/assets/icons/svg
    breadcrumb: false               // 如果设置为false，则不会在breadcrumb面包屑中显示
    activeMenu: '/system/user'      // 当路由设置了该属性，则会高亮相对应的侧边栏。
  }
 */
//菜单图标
import ico_m1 from '../assets/img/ico_m1.png';
import ico_m2 from '../assets/img/ico_m2.png';
import ico_m3 from '../assets/img/ico_m3.png';
import ico_m4 from '../assets/img/ico_m4.png';
import ico_m5 from '../assets/img/ico_m5.png';
import ico_m6 from '../assets/img/ico_m6.png';
import ico_m7 from '../assets/img/ico_m7.png';
import ico_m8 from '../assets/img/ico_m8.png';
import ico_m9 from '../assets/img/ico_m9.png';
import ico_m10 from '../assets/img/ico_m10.png';
const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL),
    routes: [
        {
            path: '',
            component: Layout,
            redirect: '/index',
            children: [
                {
                    path: '/index',
                    component: () => import('@/views/home.vue'),
                    name: 'homeIndex',
                    meta: { title: '首页', breadcrumb: true, icon: ico_m1, activeMenu: '/index' }
                },
                {
                    path: '/coalStatistics',
                    component: () => import('@/views/coal/statistics.vue'),
                    name: 'CoalStatistics',
                    meta: { title: '煤场概览', breadcrumb: true, icon: ico_m2, activeMenu: '/coalStatistics'},
                },
                /*
                {
                    path: '/coalRecord',
                    component: () => import('@/views/coal/record.vue'),
                    name: 'CoalRecord',
                    meta: { title: '盘煤记录', breadcrumb: true}
                },
                {
                    path: '/recordInfo',
                    redirect: '/coalRecord/info',
                    meta: { title: '盘煤记录', breadcrumb: true},
                    children: [
                        {
                            path: '/coalRecord/info',
                            component: () => import('@/views/coal/recordInfo.vue'),
                            name: 'RecordInfo',
                            meta: { title: '详情', breadcrumb: true},
                        }
                    ]
                },
                {
                    path: '/recordReport',
                    redirect: '/coalRecord/report',
                    meta: { title: '盘煤记录', breadcrumb: true},
                    children: [
                        {
                            path: '/coalRecord/report',
                            component: () => import('@/views/coal/report.vue'),
                            name: 'RecordReport',
                            meta: { title: '检测报告', breadcrumb: true},
                        }
                    ]
                },
                {
                    path: '/analyse',
                    component: () => import('@/views/coal/analyse.vue'),
                    name: 'Analyse',
                    meta: { title: '盘煤分析', breadcrumb: true}
                },
                {
                    path: '/statistics',
                    component: () => import('@/views/coal/statistics.vue'),
                    name: 'Statistics',
                    meta: { title: '盘煤记录', breadcrumb: true}
                },
                */
                //料场监控
                {
                    path: '/stock',
                    redirect: 'noRedirect',
                    meta: { title: '料场监控', breadcrumb: true, icon: ico_m4},
                    children: [
                        {
                            path: '/stock/record',
                            component: () => import('@/views/coal/record.vue'),
                            name: 'Stock',
                            meta: { title: '盘煤记录', breadcrumb: false},
                        },
                        {
                            path: '',
                            redirect: '/stock/record',
                            meta: { title: '盘煤记录', breadcrumb: false, hidden: true},
                            children: [
                                {
                                    path: '/stock/record/info',
                                    component: () => import('@/views/coal/recordInfo.vue'),
                                    name: 'stockRecordInfocoal',
                                    meta: { title: '详情', breadcrumb: false},
                                },
                                {
                                    path: '/stock/record/report',
                                    component: () => import('@/views/coal/report.vue'),
                                    name: 'CoalRecordReport',
                                    meta: { title: '检测报告', breadcrumb: true},
                                }
                            ]
                        },
                        {
                            path: '',
                            redirect: 'noRedirect',
                            meta: { title: '煤场监测', breadcrumb: true},
                            children: [
                                {
                                    path: '/stock/coal/measure',
                                    component: () => import('@/views/stock/measure.vue'),
                                    name: 'Measure',
                                    meta: { title: '三维动态测量', breadcrumb: true},
                                },
                                {
                                    path: '/stock/yard3d',
                                    component: () => import('@/views/stock/yard3d.vue'),
                                    name: 'StockYard3d',
                                    meta: { title: '三维煤场1', breadcrumb: false},
                                },
                                {
                                    path: '/stock/yard',
                                    component: () => import('@/views/stock/yard.vue'),
                                    name: 'StockYard',
                                    meta: { title: '三维煤场', breadcrumb: false},
                                },
                                {
                                    path: '/stock/coalPile',
                                    component: () => import('@/views/stock/coalPile.vue'),
                                    name: 'StockCoalPile',
                                    meta: { title: '煤堆信息', breadcrumb: false},
                                },
                                {
                                    path: '/stock/coalInfo',
                                    component: () => import('@/views/stock/coalInfo.vue'),
                                    name: 'StockCoalInfo',
                                    meta: { title: '煤堆一览表', breadcrumb: false},
                                },
                                {
                                    path: '/stock/environment',
                                    component: () => import('@/views/stock/environment.vue'),
                                    name: 'Environment',
                                    meta: { title: '环境监测', breadcrumb: false},
                                },
                                
                            ]
                        },
                        {
                            path: '/stock/video',
                            component: () => import('@/views/stock/video.vue'),
                            name: 'StockVideo',
                            meta: { title: '视频在线', breadcrumb: false, activeMenu: '/stock/video'},
                        },
                        {
                            path: '/videoInfo',
                            redirect: '/stock/videoInfo',
                            meta: { title: '视频在线', breadcrumb: false, hidden: true},
                            children:[
                                {
                                    path: '/stock/videoInfo',
                                    component: () => import('@/views/stock/videoInfo.vue'),
                                    name: 'VideoInfo',
                                    meta: { title: '视频在线', breadcrumb: false, activeMenu: '/stock/video'},
                                },
                            ]
                        },
                        
                    ]
                },
                //入场管理
                {
                    path: '/entrance',
                    redirect: 'noRedirect',
                    meta: { title: '入场管理', breadcrumb: true, icon: ico_m5},
                    children: [
                        {
                            path: '/entrancePlan',
                            component: () => import('@/views/entrance/plan.vue'),
                            name: 'EntrancePlan',
                            meta: { title: '来煤计划', breadcrumb: true},
                        },
                        {
                            path: '/entranceQuality',
                            component: () => import('@/views/entrance/quality.vue'),
                            name: 'EntranceQuality',
                            meta: { title: '来煤煤质', breadcrumb: true},
                        },
                        {
                            path: '/entranceRecord',
                            component: () => import('@/views/entrance/record.vue'),
                            name: 'EntranceRecord',
                            meta: { title: '来煤记录', breadcrumb: false},
                            children: [
                                {
                                    path: '/entranceReport',
                                    component: () => import('@/views/entrance/report.vue'),
                                    name: 'EntranceReport',
                                    meta: { title: '检测报告', breadcrumb: false},
                                }
                            ]
                        },
                        {
                            path: '/entranceScale',
                            component: () => import('@/views/entrance/scale.vue'),
                            name: 'EntranceScale',
                            meta: { title: '皮带秤记录', breadcrumb: true},
                        },
                    ]
                },
                //入炉管理
                {
                    path: '/furnacee',
                    redirect: 'noRedirect',
                    meta: { title: '入炉管理', breadcrumb: true, icon: ico_m6},
                    children: [
                        {
                            path: '/furnaceeQuality',
                            component: () => import('@/views/furnace/quality.vue'),
                            name: 'FurnaceQuality',
                            meta: { title: '入炉煤质', breadcrumb: false},
                            children: [
                                {
                                    path: '/furnaceeExport',
                                    component: () => import('@/views/furnace/export.vue'),
                                    name: 'FurnaceeExport',
                                    meta: { title: '导出', breadcrumb: false}
                                }
                            ]
                        },
                        {
                            path: '/furnaceeRecord',
                            component: () => import('@/views/furnace/record.vue'),
                            name: 'FurnaceRecord',
                            meta: { title: '入炉记录', breadcrumb: true}
                        },
                        {
                            path: '/furnaceeScale',
                            component: () => import('@/views/furnace/scale.vue'),
                            name: 'FurnaceScale',
                            meta: { title: '皮带秤记录', breadcrumb: true}
                        },
                    ]
                },
                
                //设施设备
                {
                    path: '/device',
                    redirect: 'noRedirect',
                    meta: { title: '设施设备', breadcrumb: true, icon: ico_m7},
                    children: [
                        {
                            path: '/device/control',
                            component: () => import('@/views/device/control.vue'),
                            name: 'DeviceControl',
                            meta: { title: '输煤程控', breadcrumb: true},
                            children: []
                        },
                        {
                            path: '/device/manage',
                            component: () => import('@/views/device/manage.vue'),
                            name: 'DeviceManage',
                            meta: { title: '设备管理', breadcrumb: true},
                            children: []
                        },
                        {
                            path: '/device/warning',
                            component: () => import('@/views/device/warning.vue'),
                            name: 'DeviceWarning',
                            meta: { title: '设备报警', breadcrumb: true},
                            children: []
                        },
                    ]
                },
                //统计分析
                {
                    path: '/statistic',
                    redirect: 'noRedirect',
                    meta: { title: '统计分析', breadcrumb: true, icon: ico_m8},
                    children: [
                        {
                            path: '/statistic/coalArrival',
                            component: () => import('@/views/statistic/coalArrival.vue'),
                            name: 'CoalArrival',
                            meta: { title: '来煤统计', breadcrumb: true},
                            children: []
                        },
                        {
                            path: '/statistic/furnace',
                            component: () => import('@/views/statistic/furnace.vue'),
                            name: 'Furnace',
                            meta: { title: '入炉统计', breadcrumb: true},
                            children: []
                        },
                        {
                            path: '/statistic/checkAnalyse',
                            component: () => import('@/views/statistic/checkAnalyse.vue'),
                            name: 'CheckAnalyse',
                            meta: { title: '盘煤结果分析', breadcrumb: true},
                            children: []
                        },
                        {
                            path: '/statistic/checkStatistic',
                            component: () => import('@/views/statistic/checkStatistic.vue'),
                            name: 'CheckStatistic',
                            meta: { title: '盘煤统计', breadcrumb: true},
                            children: []
                        },
                        {
                            path: '/statistic/device',
                            component: () => import('@/views/statistic/device.vue'),
                            name: 'Device',
                            meta: { title: '设备统计', breadcrumb: true},
                            children: []
                        },
                    ]
                },
                //系统管理
                {
                    path: '/system',
                    redirect: 'noRedirect',
                    meta: { title: '系统管理', breadcrumb: true,icon: ico_m9}, 
                    children: [
                        {
                            path: '/systemYard',
                            component: () => import('@/views/system/yard.vue'),
                            name: 'SystemYard',
                            meta: { title: '煤场管理', breadcrumb: true},
                            children: []
                        },
                        {
                            path: '/systemZone',
                            component: () => import('@/views/system/zone.vue'),
                            name: 'SystemZone',
                            meta: { title: '煤场分区', breadcrumb: true},
                            children: []
                        },
                        {
                            path: '/systemType',
                            component: () => import('@/views/system/type.vue'),
                            name: 'SystemType',
                            meta: { title: '煤种管理', breadcrumb: true},
                            children: []
                        },
                        {
                            path: '/systemBoiler',
                            component: () => import('@/views/system/boiler.vue'),
                            name: 'systemBoiler',
                            meta: { title: '锅炉管理', breadcrumb: true},
                            children: []
                        },
                        {
                            path: '/systemScale',
                            component: () => import('@/views/system/scale.vue'),
                            name: 'SystemScale',
                            meta: { title: '皮带秤管理', breadcrumb: true},
                            children: []
                        },
                        {
                            path: '/systemSupplier',
                            component: () => import('@/views/system/supplier.vue'),
                            name: 'SystemSupplier',
                            meta: { title: '供应商管理', breadcrumb: true},
                        },
                    ]
                },
                
                

            ]
        },
       
    ]
})

export default router
